class Solution {
public:
    int count_wind(const string str)
    {
        int count = 0;
        for (const auto& ch : str)
        {
            if (ch == ' ')
                count++;
        }
        return count + 1;
    }
    int mostWordsFound(vector<string>& sentences) {
        /*int res = 0;
        for(const auto& str : sentences)
        {
            int cnt = count(str.begin(), str.end(), ' ') + 1;
            res = max(res, cnt);
        }
        return res;*/
        int res = 0;
        for (const auto& str : sentences)
        {
            int cnt = count_wind(str);
            res = max(res, cnt);
        }
        return res;
    }
};